%rebase base/layout title="Ivan's Blog - " + art.subject
%from utils import check_login,syntaxhighlighter
<div id="latest-post" class="post">
	<h1 class="title">
		{{art.subject}}	
		%if check_login():
		<span style="font-size:12px;"><a href="/editarticle/{{art.id}}">[编辑]</a>&nbsp;<a href="/deletearticle/{{art.id}}">[删除]</a></span>
		%end
	</h1>
	<div class="entry">
		<p>
			%str = syntaxhighlighter(art.full_content)
			{{!str}}
		</p>
		<p>类别: <a href="/viewcategory/{{art.category_id}}">{{art.cate_name}}</a>&nbsp;&nbsp;
		%if art.tags:
			标签:
			%for tag in art.tags:
			<a href="/tag/{{tag.val}}">{{tag.val}}&nbsp;</a>
			%end
		%end
		</p>
		<p class="meta">
			<span class="posted"><a href="#">多多洛</a>&nbsp;&nbsp;发表于&nbsp;&nbsp;{{art.create_date.strftime("%Y年%m月%d日")}}</span>
		</p>
	</div>
	
	<div style="border-top: 1px solid #ccc;padding: 5px;" id="comments">
		<h3>评论</h3>
		<dl>
			%for i,comment in enumerate(comments):
			<dd>
				<div><b>{{i+1}}.</b>&nbsp;&nbsp;<span style="color:#00f">{{comment.username}}</span>&nbsp;&nbsp;{{comment.create_date.strftime("%Y年%m月%d日%H:%M")}}</div>	
				<p style="margin: 4px;">{{comment.content}}</p>
			</dd>
			%end
		</dl>
	</div>
	
	<div style="border-top: 1px solid #ccc;padding: 5px;" id="post_comment">
		<h3>发表评论</h3>
		%if error:
		<div class="error">{{error}}</div>
		%end
		<form action="/savecomment#post_comment" method="post">
			<input type="hidden" name="art_id" value="{{art.id}}"/>
			<br/><input type="text" name="username" id="username" value="{{data['username']}}" maxlength="20"/><label for="username">&nbsp;姓名&nbsp;(必须) </label>
			<br/><textarea style="width: 430px; height: 155px;" name="content">{{data['content']}}</textarea>&nbsp;(必须)
			<br/><input type="submit" value="发表评论" class="btncls"/>
		</form>
	</div>
</div>
<link type="text/css" rel="stylesheet" href="/style/syntax_highlighter/shCore.css"/>
<link type="text/css" rel="stylesheet" href="/style/syntax_highlighter/shCoreDefault.css"/>
<script type="text/javascript" src="/scripts/syntax_highlighter/shCore.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shAutoloader.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushCSharp.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushJava.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushJScript.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushPlain.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushPython.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushRuby.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushScala.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushCpp.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushCss.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushPhp.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushSql.js"></script>
<script type="text/javascript" src="/scripts/syntax_highlighter/shBrushXml.js"></script>
<script type="text/javascript">SyntaxHighlighter.all();</script>
<div id="sidebar1">
	%include base/left
</div>